package com.kitty.game.gm.handler;

import com.kitty.common.utils.SpringUtils;
import com.kitty.game.equip.message.RespNotifyMiscEx;
import com.kitty.game.role.model.Role;
import com.kitty.game.role.service.PayService;
import com.kitty.mina.cache.DataCache;
import com.kitty.mina.message.MessagePusher;

import java.util.Collection;

public class GmChoujiangAll implements GMFather {

    @Override
    public boolean handle(Role aaaaa, String content) {
        int value = Integer.parseInt(content);
        Collection<Role> roles = DataCache.ONLINE_ROLES.values();
        for (Role role : roles) {
            MessagePusher.pushMessage(role, new RespNotifyMiscEx("已经收到补偿#R" + value + "抽奖！！"));
            SpringUtils.getBean(PayService.class).choujiang(role, value);
        }
        return true;
    }
}
